package homework.day13;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.List;

public class ProductImpl implements IProductDao{
    public static final String PATH="";


    @Override
    public List<Product> findAll() {
        ObjectInputStream in=null;
        List<Product> products=null;
        try {
            in=new ObjectInputStream(new FileInputStream(PATH));
            try {
                products = (List<Product>) in.readObject();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }
        } catch (IOException e) {
          //  e.printStackTrace();
            return null;
        }finally {
            if(null!=in){
                try {
                    in.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

        return null;
    }

    @Override
    public void save(Product product) {

    }

    @Override
    public void delByrand(String brand) {

    }
}
